﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Media;
namespace Form12
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            label2.Text = DateTime.Now.ToString();
            
            SoundPlayer sp = new SoundPlayer();
            sp.SoundLocation = @"D:\source\repos\Form12 Timer\Form12\铃声多多_7妹 - 梦里寻他千百度 (Remix)_fakyou.wav";
            if (DateTime.Now.Hour == 11 && DateTime.Now.Minute == 13 && DateTime.Now.Second == 0) 
            {
               // sp.Play();//单次播放
                sp.PlayLooping();//循环播放
            }
            if (DateTime.Now.Hour == 11 && DateTime.Now.Minute == 13 && DateTime.Now.Second == 30) 
            {
                sp.Stop();//停止播放
            }
        }

        private void Form2_Load(object sender, EventArgs e)
        {
           
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form3 f3 = new Form3();
            f3.Show();
            this.Hide();
        }
    }
}
